Field of the Invention
The present invention relates to processing of decoding compressed image data.
Description of the Related Art
An image compression technique is applied to high-resolution image data having an enormous data amount to store the image data using smaller memory resources and transfer the image data via a network within a shorter time. On the other hand, the image compression technique is required not to degrade the image quality. As an image compression technique for decreasing a data amount while maintaining the image quality, U.S. Pat. No. 5,883,976 discloses a technique of dividing an image into one or more regions each including one or more pixels and switching a data compression method for each region.
As a technique of dividing an image into one or more regions and switching a data compression method, there is provided a technique of encoding image data to boundary data (to be referred to as region boundary data hereinafter) of regions and compressed data (to be referred to as region compression data hereinafter) of the regions. Each region boundary data includes information for specifying the position of a boundary, and attribute information for specifying the data compression method and region compression data of a region on the right side of the boundary.
The above technique adopts, as data compression methods, run-length encoding of a lossless-compression method and JPEG of a lossy-compression method. Therefore, the size of a region (to be referred to as a lossy-compression region hereinafter) to which the lossy-compression method is applied is restricted to an integer multiple of a minimum coding unit (MCU) which includes eight pixels in each of the horizontal and vertical directions. Thus, the lossy-compression region includes unnecessary pixels overlapping a region (to be referred to as lossless-compression region hereinafter) to which the lossless-compression method is applied.
An apparatus for decoding encoded data in which the lossy-compression region and the lossless-compression region coexist executes the following two steps. In the first step, the apparatus decodes the data (to be referred to as the lossy-compressed data hereinafter) of the lossy-compression region, and writes the resultant data in a memory. In the second step, the apparatus specifies the position of a boundary, decodes the data (to be referred to as the lossless-compressed data hereinafter) of the lossless-compression region, and writes the resultant data in the memory. At this time, the apparatus overwrites the pixel data written in the lossless-compression region in the first step.
As described above, when writing, in the memory, the decompression result of a compressed image including lossy-compressed data and lossless-compressed data, there are pixels where the decompression result of the lossy-compressed data is overwritten by that of the lossless-compressed data. As a result, a system bus band and a memory band are wastefully consumed.